import os

from django.http import JsonResponse


def get_FileSize(file):
    with open('./lovehome_pro/apps/Leisuerly/' + file.name, 'wb') as f:
        for line in file.chunks():
            f.write(line)

    with open('./lovehome_pro/apps/Leisuerly/' + file.name, 'rb') as f:

        return f.read()


# if __name__ == '__main__':
#     a =get_FileSize('TIM图片20200102222506.jpg')
#     print(a)
